<div class="pageContent">
    <div id="service" class="unitBox" style="display:block; overflow:auto;">
        <div class="pageFormContent">
        <input type="hidden" name="navTabId" value="${navTabId!''}">
        <fieldset style="border:1px dashed #d8dfe5";>
        <dl>
            <dt><@label key='service_name.C,colon'>服务名称：</@label></dt>
            <dd><input name="serviceName"   value="<#if (service.serviceName)??>${service.serviceName!''}</#if>" type="text" maxlength="32"  readonly="readonly"/></dd>
        </dl>
        <dl>
            <dt><@label key='service_code.C,colon'>服务标识：</@label></dt>
            <dd><input name="serviceCode"   value="<#if (service.serviceCode)??>${service.serviceCode!''}</#if>"  type="text" maxlength="32"   readonly="readonly"/></dd>
        </dl>
        <dl>
            <dt>url：</dt>
            <dd><input name="url"  value="<#if (service.url)??>${service.url!''}</#if>" type="text"  readonly="readonly"/></dd>
        </dl>
        <dl  class="nowrap">
            <dt><@label key='service_inparam.C,colon'>输入参数：</@label></dt>
            <dd><textarea name="inParam" rows="2" cols="40" ><#if (service.inParam)??>${service.inParam!''}</#if></textarea></dd>
        </dl>
        </fieldset>
        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="testService();"><@label key='Test.B'>测试</@label></button></div></div></li>
            </ul>
        </div>
    </div>
    <div id="serviceResult" class="unitBox"">
        <div class="pageFormContent" layoutH="56">
        <input type="hidden" name="navTabId" value="${navTabId!''}">
        <fieldset fieldset style="border:1px dashed #d8dfe5;">
        <dl>
            <dt><@label key='service_statusCode.C,colon'>状态码：</@label></dt>
            <dd><input name="resultStatus"   value="" type="text" maxlength="32"  readonly="readonly"/></dd>
        </dl>

        <dl>
            <dt><@label key='service_beginTime.C,colon'>执行开始时间：</@label> </dt>
            <dd><input name="beginTime"  value="" type="text"  readonly="readonly"/></dd>
        </dl>
        <dl>
            <dt><@label key='service_endTime.C,colon'>执行结束时间：</@label></dt>
            <dd><input name="endTime"  value="" type="text"  readonly="readonly"/></dd>
        </dl>
        <dl>
            <dt><@label key='service_time.C,colon'>执行时间：</@label></dt>
            <dd><input name="time"  value="" type="text"  readonly="readonly"/></dd>
        </dl>
        <dl  class="nowrap">
            <dt><@label key='service_result.C,colon'>返回结果：</@label></dt>
            <dd><textarea name="returnVal" rows="4" cols="40" ></textarea></dd>
        </dl>
        </fieldset>
        
        </div>
    </div>
</div>
<script type="text/javascript">
    function testService() {
        var inParam  = $("textarea[name='inParam']").val();
         $.DWZajax({
               type : "post",
               data : {
                   "id" : <#if (service.id)??>${service.id!''}</#if>,
                    "inParam":inParam
               },
               url : hostUrl + '/service/runService',
               
               callback : function(getdata) {
                   if(getdata){
                       $("textarea[name='returnVal']").val(getdata.returnVal);
                       $("input[name='beginTime']").val(getdata.beginTime);
                       $("input[name='endTime']").val(getdata.endTime);
                       $("input[name='time']").val(getdata.times);
                       if(getdata.resultStatus == DWZ.statusCode.ok){
                           $("input[name='resultStatus']").val("<@label key='success.C'>成功</@label>")
                       }else if(getdata.resultStatus == DWZ.statusCode.error){
                           $("input[name='resultStatus']").val("<@label key='fail.C'>失败</@label>")
                       }
                   }
               }
           });
    }
</script>